/*
 * $Id: $
 */
package org.rcgwt.client.ui.grid.internal;

import org.rcgwt.client.ui.grid.internal.model.IGridModel;
import org.rcgwt.client.ui.grid.internal.model.IViewModel;
import org.rcgwt.client.ui.grid.renderer.IGridRenderContext;
import org.rcgwt.client.ui.grid.renderer.IViewRenderContext;

/**
 * 
 * @author Olivier Oeuillot (latest modification by $Author: $)
 * @version $Revision: $ $Date: $
 */
public class ViewRenderContextImpl extends AbstractGridRenderContext implements
        IViewRenderContext {

    private IViewModel currentView;

    public ViewRenderContextImpl(IGridModel gridModel) {
        super(gridModel);
    }

    @Override
    public final IGridRenderContext getGridRenderContext() {
        return this;
    }

    @Override
    public final IViewModel getViewModel() {
        return currentView;
    }

    public IViewRenderContext getViewRenderContext(IViewModel view) {
        currentView = view;

        return this;
    }
}
